Table of Contents [Hide/Show]
Jetfire Overview Hello World DVD Library Example Enhancing the DVD Workflow Class See Also
// A very simple Jetfire workflow (class) // This code can be selected, copied (cntrl c) and pasted (cntrl v) into the Jetfire dashboard. namespace test { workflow HelloWorld { DateTime creationTime = DateTime.Now; public string Hello { get{return "This workflow was created at:" + creationTime.ToString();} } } }
// This code can be selected, copied (cntrl c) and pasted (cntrl v) into the Jetfire dashboard. // This is Jetfire script code. Yes it does look a lot like C#. namespace DVDLib { // This workflow demonstrates using the 'states' modifier for methods. workflow DVD { // This is a state name CheckedIn- it looks like a constructor // Instances of this workflow class with be in one of the defined states. CheckedIn() { // place code here to be executed with the workflow enters the "CheckedIn" state. } Borrowed(){} // constructor - this is not a state. // It is a constructor because its name ('DVD') is the same as the workflow name. public DVD() { enterstate CheckedIn(); } // This is a method. // The 'Borrow' method is only public when this workflow state is 'Borrowed'. // When this workflow is not in the 'Borrowed' state the 'Borrow' method is private. public void Borrow() :states(CheckedIn) { enterstate Borrowed(); } public void Return() :states(Borrowed) { enterstate CheckedIn(); } string title = "no title"; // gets and sets the 'Title' of this DVD instance. public string Title{ get{return this.title;} set{this.title = value;} } } }